﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        private int[] array = { 7, 5, 3, 77, 55, 33, 28 };
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Array.Sort(array);
            MessageBox.Show("最大值为"+array[6]);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Array.Sort(array);
            MessageBox.Show("最小值为" + array[0]);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            double sum=0;
            double ava=0;
            for (int i = 0; i < array.Length; i++)
                sum += array[i];
            ava = sum / array.Length;
            MessageBox.Show("平均数为"+ava);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            double sum = 0;
            for (int i = 0; i < array.Length; i++)
                sum += array[i];
            MessageBox.Show("总和为" + sum);

        }

        private void textBox5_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox4_TextChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button5_Click(object sender, EventArgs e)
        {
            
        }
    }
}
